package com.sy.controller.inventory;

import com.sy.bean.inventory.InventoryFlows;
import com.sy.bean.inventory.InventoryFlowsQuery;
import com.sy.common.bean.PageBean;
import com.sy.common.bean.ResultBean;
import com.sy.common.controller.BaseController;
import com.sy.common.utils.BeanOfMap;
import com.sy.service.impl.inventory.InventoryFlowsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "库存流水列表")
@RequestMapping("/api/inventory")
public class InventoryFlowsController extends BaseController {

    @Autowired
    InventoryFlowsServiceImpl inventoryFlowsService;

    @PostMapping("/query")
    @ApiOperation(value = "查询库存流水列表")
    public ResultBean query(@RequestBody InventoryFlowsQuery query) {
        PageBean<InventoryFlows> list = inventoryFlowsService.query(BeanOfMap.bom(query));
        return success("库存流水列表", list);
    }
}
